<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Flow: flow::log::Simple_ostream_logger Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Flow<span id="projectnumber">&#160;2.0.0</span>
   </div>
   <div id="projectbrief">Flow project: Full implementation reference.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceflow.html">flow</a></li><li class="navelem"><a class="el" href="namespaceflow_1_1log.html">log</a></li><li class="navelem"><a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html">Simple_ostream_logger</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pri-types">Private Types</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classflow_1_1log_1_1Simple__ostream__logger-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">flow::log::Simple_ostream_logger Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>An implementation of <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> that logs messages to the given <code>ostream</code>s (e.g., <code>cout</code> or an <code>ofstream</code> for a file).  
 <a href="classflow_1_1log_1_1Simple__ostream__logger.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="simple__ostream__logger_8hpp_source.html">simple_ostream_logger.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for flow::log::Simple_ostream_logger:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classflow_1_1log_1_1Simple__ostream__logger__inherit__graph.svg" width="460" height="203"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for flow::log::Simple_ostream_logger:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classflow_1_1log_1_1Simple__ostream__logger__coll__graph.svg" width="1415" height="652"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a5ee701f0f163047f9620ab91d653da18"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a5ee701f0f163047f9620ab91d653da18">Simple_ostream_logger</a> (<a class="el" href="classflow_1_1log_1_1Config.html">Config</a> *config, std::ostream &amp;os=std::cout, std::ostream &amp;os_for_err=std::cerr)</td></tr>
<tr class="memdesc:a5ee701f0f163047f9620ab91d653da18"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs logger to subsequently log to the given standard <code>ostream</code> (or 2 thereof).  <a href="classflow_1_1log_1_1Simple__ostream__logger.html#a5ee701f0f163047f9620ab91d653da18">More...</a><br /></td></tr>
<tr class="separator:a5ee701f0f163047f9620ab91d653da18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf1987dc4e163db1c13e6f4407135fa9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbool.html">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#aaf1987dc4e163db1c13e6f4407135fa9">should_log</a> (<a class="el" href="namespaceflow_1_1log.html#a5c602384e6fe9d7642740ac2fae4ad04">Sev</a> sev, const <a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;component) const override</td></tr>
<tr class="memdesc:aaf1987dc4e163db1c13e6f4407135fa9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Implements interface method by returning <code>true</code> if the severity and component (which is allowed to be null) indicate it should.  <a href="classflow_1_1log_1_1Simple__ostream__logger.html#aaf1987dc4e163db1c13e6f4407135fa9">More...</a><br /></td></tr>
<tr class="separator:aaf1987dc4e163db1c13e6f4407135fa9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1548d51e8314a9cff0669f20cae9ae76"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classbool.html">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a1548d51e8314a9cff0669f20cae9ae76">logs_asynchronously</a> () const override</td></tr>
<tr class="memdesc:a1548d51e8314a9cff0669f20cae9ae76"><td class="mdescLeft">&#160;</td><td class="mdescRight">Implements interface method by returning <code>false</code>, indicating that this <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> will not need the contents of <code>*metadata</code> and <code>msg</code> passed to <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a44192b92a16bc07f8d99beb6ad25c826" title="Implements interface method by synchronously logging the message and some subset of the metadata in a...">do_log()</a>, as the latter will output them synchronously.  <a href="classflow_1_1log_1_1Simple__ostream__logger.html#a1548d51e8314a9cff0669f20cae9ae76">More...</a><br /></td></tr>
<tr class="separator:a1548d51e8314a9cff0669f20cae9ae76"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44192b92a16bc07f8d99beb6ad25c826"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a44192b92a16bc07f8d99beb6ad25c826">do_log</a> (<a class="el" href="structflow_1_1log_1_1Msg__metadata.html">Msg_metadata</a> *metadata, <a class="el" href="namespaceflow_1_1util.html#ae4dc52186797094b3040379ff19124c9">util::String_view</a> msg) override</td></tr>
<tr class="memdesc:a44192b92a16bc07f8d99beb6ad25c826"><td class="mdescLeft">&#160;</td><td class="mdescRight">Implements interface method by synchronously logging the message and some subset of the metadata in a fashion controlled by <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a57abde2223144cdec0f1f4edc35fdc88" title="Reference to the config object passed to constructor. Note that object is mutable; see notes on threa...">m_config</a>.  <a href="classflow_1_1log_1_1Simple__ostream__logger.html#a44192b92a16bc07f8d99beb6ad25c826">More...</a><br /></td></tr>
<tr class="separator:a44192b92a16bc07f8d99beb6ad25c826"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classflow_1_1log_1_1Logger"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classflow_1_1log_1_1Logger')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classflow_1_1log_1_1Logger.html">flow::log::Logger</a></td></tr>
<tr class="memitem:ac8a2e7a33fe3fbc0c29ead62ed98c022 inherit pub_methods_classflow_1_1log_1_1Logger"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classbool.html">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Logger.html#ac8a2e7a33fe3fbc0c29ead62ed98c022">should_log</a> (<a class="el" href="namespaceflow_1_1log.html#a5c602384e6fe9d7642740ac2fae4ad04">Sev</a> sev, const <a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;component) const =0</td></tr>
<tr class="memdesc:ac8a2e7a33fe3fbc0c29ead62ed98c022 inherit pub_methods_classflow_1_1log_1_1Logger"><td class="mdescLeft">&#160;</td><td class="mdescRight">Given attributes of a hypothetical message that would be logged, return <code>true</code> if that message should be logged and <code>false</code> otherwise (e.g., if the verbosity of the message is above the current configured verbosity threshold for the <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> specified).  <a href="classflow_1_1log_1_1Logger.html#ac8a2e7a33fe3fbc0c29ead62ed98c022">More...</a><br /></td></tr>
<tr class="separator:ac8a2e7a33fe3fbc0c29ead62ed98c022 inherit pub_methods_classflow_1_1log_1_1Logger"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae04868e2a384e60a349ecba8340cd731 inherit pub_methods_classflow_1_1log_1_1Logger"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classbool.html">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Logger.html#ae04868e2a384e60a349ecba8340cd731">logs_asynchronously</a> () const =0</td></tr>
<tr class="memdesc:ae04868e2a384e60a349ecba8340cd731 inherit pub_methods_classflow_1_1log_1_1Logger"><td class="mdescLeft">&#160;</td><td class="mdescRight">Must return <code>true</code> if <a class="el" href="classflow_1_1log_1_1Logger.html#a934667f16dd6ca0841e521296ab3a6e2" title="Given a message and its severity, logs that message and possibly severity WITHOUT checking whether it...">do_log()</a> at least sometimes logs the given message and metadata (e.g., time stamp) after <a class="el" href="classflow_1_1log_1_1Logger.html#a934667f16dd6ca0841e521296ab3a6e2" title="Given a message and its severity, logs that message and possibly severity WITHOUT checking whether it...">do_log()</a> returns; <code>false</code> if this never occurs (i.e., it logs synchronously, always).  <a href="classflow_1_1log_1_1Logger.html#ae04868e2a384e60a349ecba8340cd731">More...</a><br /></td></tr>
<tr class="separator:ae04868e2a384e60a349ecba8340cd731 inherit pub_methods_classflow_1_1log_1_1Logger"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a934667f16dd6ca0841e521296ab3a6e2 inherit pub_methods_classflow_1_1log_1_1Logger"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Logger.html#a934667f16dd6ca0841e521296ab3a6e2">do_log</a> (<a class="el" href="structflow_1_1log_1_1Msg__metadata.html">Msg_metadata</a> *metadata, <a class="el" href="namespaceflow_1_1util.html#ae4dc52186797094b3040379ff19124c9">util::String_view</a> msg)=0</td></tr>
<tr class="memdesc:a934667f16dd6ca0841e521296ab3a6e2 inherit pub_methods_classflow_1_1log_1_1Logger"><td class="mdescLeft">&#160;</td><td class="mdescRight">Given a message and its severity, logs that message and possibly severity WITHOUT checking whether it should be logged (i.e., without performing logic that <a class="el" href="classflow_1_1log_1_1Logger.html#ac8a2e7a33fe3fbc0c29ead62ed98c022" title="Given attributes of a hypothetical message that would be logged, return true if that message should b...">should_log()</a> performs).  <a href="classflow_1_1log_1_1Logger.html#a934667f16dd6ca0841e521296ab3a6e2">More...</a><br /></td></tr>
<tr class="separator:a934667f16dd6ca0841e521296ab3a6e2 inherit pub_methods_classflow_1_1log_1_1Logger"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6ead44c19a7b15111b2f77656a2ea31 inherit pub_methods_classflow_1_1log_1_1Logger"><td class="memItemLeft" align="right" valign="top">std::ostream *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Logger.html#ad6ead44c19a7b15111b2f77656a2ea31">this_thread_ostream</a> () const</td></tr>
<tr class="memdesc:ad6ead44c19a7b15111b2f77656a2ea31 inherit pub_methods_classflow_1_1log_1_1Logger"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the stream dedicated to the executing thread and <code>this</code> <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a>, so that the caller can apply state-setting formatters to it.  <a href="classflow_1_1log_1_1Logger.html#ad6ead44c19a7b15111b2f77656a2ea31">More...</a><br /></td></tr>
<tr class="separator:ad6ead44c19a7b15111b2f77656a2ea31 inherit pub_methods_classflow_1_1log_1_1Logger"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classflow_1_1util_1_1Null__interface"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classflow_1_1util_1_1Null__interface')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classflow_1_1util_1_1Null__interface.html">flow::util::Null_interface</a></td></tr>
<tr class="memitem:a5916282577627e424a09884347eddbba inherit pub_methods_classflow_1_1util_1_1Null__interface"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1util_1_1Null__interface.html#a5916282577627e424a09884347eddbba">~Null_interface</a> ()=0</td></tr>
<tr class="memdesc:a5916282577627e424a09884347eddbba inherit pub_methods_classflow_1_1util_1_1Null__interface"><td class="mdescLeft">&#160;</td><td class="mdescRight">Boring <code>virtual</code> destructor.  <a href="classflow_1_1util_1_1Null__interface.html#a5916282577627e424a09884347eddbba">More...</a><br /></td></tr>
<tr class="separator:a5916282577627e424a09884347eddbba inherit pub_methods_classflow_1_1util_1_1Null__interface"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classflow_1_1util_1_1Unique__id__holder"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classflow_1_1util_1_1Unique__id__holder')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classflow_1_1util_1_1Unique__id__holder.html">flow::util::Unique_id_holder</a></td></tr>
<tr class="memitem:a90705293787069f52372638d5450ef52 inherit pub_methods_classflow_1_1util_1_1Unique__id__holder"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1util_1_1Unique__id__holder.html#a90705293787069f52372638d5450ef52">Unique_id_holder</a> ()</td></tr>
<tr class="memdesc:a90705293787069f52372638d5450ef52 inherit pub_methods_classflow_1_1util_1_1Unique__id__holder"><td class="mdescLeft">&#160;</td><td class="mdescRight">Thread-safely construct an ID whose value is different from any other object of this class, past or future.  <a href="classflow_1_1util_1_1Unique__id__holder.html#a90705293787069f52372638d5450ef52">More...</a><br /></td></tr>
<tr class="separator:a90705293787069f52372638d5450ef52 inherit pub_methods_classflow_1_1util_1_1Unique__id__holder"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb06f3132d6a6d1d0c509cbd50b9f768 inherit pub_methods_classflow_1_1util_1_1Unique__id__holder"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1util_1_1Unique__id__holder.html#abb06f3132d6a6d1d0c509cbd50b9f768">Unique_id_holder</a> (const <a class="el" href="classflow_1_1util_1_1Unique__id__holder.html">Unique_id_holder</a> &amp;)</td></tr>
<tr class="memdesc:abb06f3132d6a6d1d0c509cbd50b9f768 inherit pub_methods_classflow_1_1util_1_1Unique__id__holder"><td class="mdescLeft">&#160;</td><td class="mdescRight">This copy constructor is identical in behavior to <a class="el" href="classflow_1_1util_1_1Unique__id__holder.html#a90705293787069f52372638d5450ef52" title="Thread-safely construct an ID whose value is different from any other object of this class,...">Unique_id_holder()</a>, the default ctor.  <a href="classflow_1_1util_1_1Unique__id__holder.html#abb06f3132d6a6d1d0c509cbd50b9f768">More...</a><br /></td></tr>
<tr class="separator:abb06f3132d6a6d1d0c509cbd50b9f768 inherit pub_methods_classflow_1_1util_1_1Unique__id__holder"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24742b697933e623df30056aebbebfae inherit pub_methods_classflow_1_1util_1_1Unique__id__holder"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classflow_1_1util_1_1Unique__id__holder.html#af9cbe2432658aac398498e0a7e96405f">id_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1util_1_1Unique__id__holder.html#a24742b697933e623df30056aebbebfae">unique_id</a> () const</td></tr>
<tr class="memdesc:a24742b697933e623df30056aebbebfae inherit pub_methods_classflow_1_1util_1_1Unique__id__holder"><td class="mdescLeft">&#160;</td><td class="mdescRight">Raw unique ID identifying this object as well as any object of a derived type.  <a href="classflow_1_1util_1_1Unique__id__holder.html#a24742b697933e623df30056aebbebfae">More...</a><br /></td></tr>
<tr class="separator:a24742b697933e623df30056aebbebfae inherit pub_methods_classflow_1_1util_1_1Unique__id__holder"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abb6bab931f868d2a2e933d94f7540b1c inherit pub_methods_classflow_1_1util_1_1Unique__id__holder"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classflow_1_1util_1_1Unique__id__holder.html">Unique_id_holder</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1util_1_1Unique__id__holder.html#abb6bab931f868d2a2e933d94f7540b1c">operator=</a> (const <a class="el" href="classflow_1_1util_1_1Unique__id__holder.html">Unique_id_holder</a> &amp;) const</td></tr>
<tr class="memdesc:abb6bab931f868d2a2e933d94f7540b1c inherit pub_methods_classflow_1_1util_1_1Unique__id__holder"><td class="mdescLeft">&#160;</td><td class="mdescRight">This assignment operator is a <code>const</code> no-op.  <a href="classflow_1_1util_1_1Unique__id__holder.html#abb6bab931f868d2a2e933d94f7540b1c">More...</a><br /></td></tr>
<tr class="separator:abb6bab931f868d2a2e933d94f7540b1c inherit pub_methods_classflow_1_1util_1_1Unique__id__holder"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a57abde2223144cdec0f1f4edc35fdc88"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classflow_1_1log_1_1Config.html">Config</a> *const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a57abde2223144cdec0f1f4edc35fdc88">m_config</a></td></tr>
<tr class="memdesc:a57abde2223144cdec0f1f4edc35fdc88"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reference to the config object passed to constructor. Note that object is mutable; see notes on thread safety.  <a href="classflow_1_1log_1_1Simple__ostream__logger.html#a57abde2223144cdec0f1f4edc35fdc88">More...</a><br /></td></tr>
<tr class="separator:a57abde2223144cdec0f1f4edc35fdc88"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-types" name="pri-types"></a>
Private Types</h2></td></tr>
<tr class="memitem:aab34dd83954eeea35278207912589d0f"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#aab34dd83954eeea35278207912589d0f">Ostream_log_msg_writer_ptr</a> = boost::shared_ptr&lt; <a class="el" href="classflow_1_1log_1_1Ostream__log__msg__writer.html">Ostream_log_msg_writer</a> &gt;</td></tr>
<tr class="memdesc:aab34dd83954eeea35278207912589d0f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Short-hand for ref-counted pointer to a given <a class="el" href="classflow_1_1log_1_1Ostream__log__msg__writer.html" title="Utility class, each object of which wraps a given ostream and outputs discrete messages to it adorned...">Ostream_log_msg_writer</a>. See <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a1ef85d2192fb0cd3977944a20bfa61f9" title="Stream writers via which to log messages, each element corresponding to a certain set of possible sev...">m_os_writers</a> for ref-count rationale.  <a href="classflow_1_1log_1_1Simple__ostream__logger.html#aab34dd83954eeea35278207912589d0f">More...</a><br /></td></tr>
<tr class="separator:aab34dd83954eeea35278207912589d0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a1ef85d2192fb0cd3977944a20bfa61f9"><td class="memItemLeft" align="right" valign="top">boost::array&lt; <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#aab34dd83954eeea35278207912589d0f">Ostream_log_msg_writer_ptr</a>, 2 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a1ef85d2192fb0cd3977944a20bfa61f9">m_os_writers</a></td></tr>
<tr class="memdesc:a1ef85d2192fb0cd3977944a20bfa61f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stream writers via which to log messages, each element corresponding to a certain set of possible severities (as of this writing, warnings or worse versus all others).  <a href="classflow_1_1log_1_1Simple__ostream__logger.html#a1ef85d2192fb0cd3977944a20bfa61f9">More...</a><br /></td></tr>
<tr class="separator:a1ef85d2192fb0cd3977944a20bfa61f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb59fd5bf48efeb52d11af8a2d4d2379"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceflow_1_1util.html#add6ade273326f27eaf9bfd170a909626">util::Mutex_non_recursive</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#afb59fd5bf48efeb52d11af8a2d4d2379">m_log_mutex</a></td></tr>
<tr class="memdesc:afb59fd5bf48efeb52d11af8a2d4d2379"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mutex protecting against log messages being logged concurrently and thus being garbled.  <a href="classflow_1_1log_1_1Simple__ostream__logger.html#afb59fd5bf48efeb52d11af8a2d4d2379">More...</a><br /></td></tr>
<tr class="separator:afb59fd5bf48efeb52d11af8a2d4d2379"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="inherited" name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_types_classflow_1_1util_1_1Unique__id__holder"><td colspan="2" onclick="javascript:toggleInherit('pub_types_classflow_1_1util_1_1Unique__id__holder')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="classflow_1_1util_1_1Unique__id__holder.html">flow::util::Unique_id_holder</a></td></tr>
<tr class="memitem:af9cbe2432658aac398498e0a7e96405f inherit pub_types_classflow_1_1util_1_1Unique__id__holder"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1util_1_1Unique__id__holder.html#af9cbe2432658aac398498e0a7e96405f">id_t</a> = uint64_t</td></tr>
<tr class="memdesc:af9cbe2432658aac398498e0a7e96405f inherit pub_types_classflow_1_1util_1_1Unique__id__holder"><td class="mdescLeft">&#160;</td><td class="mdescRight">Raw integer type to uniquely identify a thing. 64-bit width should make overflow extremely hard to reach.  <a href="classflow_1_1util_1_1Unique__id__holder.html#af9cbe2432658aac398498e0a7e96405f">More...</a><br /></td></tr>
<tr class="separator:af9cbe2432658aac398498e0a7e96405f inherit pub_types_classflow_1_1util_1_1Unique__id__holder"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_static_methods_classflow_1_1log_1_1Logger"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classflow_1_1log_1_1Logger')"><img src="closed.png" alt="-"/>&#160;Static Public Member Functions inherited from <a class="el" href="classflow_1_1log_1_1Logger.html">flow::log::Logger</a></td></tr>
<tr class="memitem:a5600c71ccaa294650c7d34b596d90bf5 inherit pub_static_methods_classflow_1_1log_1_1Logger"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Logger.html#a5600c71ccaa294650c7d34b596d90bf5">this_thread_set_logged_nickname</a> (<a class="el" href="namespaceflow_1_1util.html#ae4dc52186797094b3040379ff19124c9">util::String_view</a> thread_nickname=<a class="el" href="namespaceflow_1_1util.html#ae4dc52186797094b3040379ff19124c9">util::String_view</a>(), <a class="el" href="classflow_1_1log_1_1Logger.html">Logger</a> *logger_ptr=0, <a class="el" href="classbool.html">bool</a> also_set_os_name=true)</td></tr>
<tr class="memdesc:a5600c71ccaa294650c7d34b596d90bf5 inherit pub_static_methods_classflow_1_1log_1_1Logger"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets or unsets the current thread's logging-worthy string name; optionally sets the OS thread name (such as visible in <code>top</code> output).  <a href="classflow_1_1log_1_1Logger.html#a5600c71ccaa294650c7d34b596d90bf5">More...</a><br /></td></tr>
<tr class="separator:a5600c71ccaa294650c7d34b596d90bf5 inherit pub_static_methods_classflow_1_1log_1_1Logger"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93541a6407b8705a76c7a161c5289b10 inherit pub_static_methods_classflow_1_1log_1_1Logger"><td class="memItemLeft" align="right" valign="top">static std::ostream &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Logger.html#a93541a6407b8705a76c7a161c5289b10">this_thread_logged_name_os_manip</a> (std::ostream &amp;os)</td></tr>
<tr class="memdesc:a93541a6407b8705a76c7a161c5289b10 inherit pub_static_methods_classflow_1_1log_1_1Logger"><td class="mdescLeft">&#160;</td><td class="mdescRight"><code>ostream</code> manipulator function that, if output via <code>operator&lt;&lt;</code> to an <code>ostream</code>, will cause the current thread's logging-worthy string name to be output to that stream.  <a href="classflow_1_1log_1_1Logger.html#a93541a6407b8705a76c7a161c5289b10">More...</a><br /></td></tr>
<tr class="separator:a93541a6407b8705a76c7a161c5289b10 inherit pub_static_methods_classflow_1_1log_1_1Logger"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d1a0283764e5f85abf00c7cee4c4e19 inherit pub_static_methods_classflow_1_1log_1_1Logger"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Logger.html#a2d1a0283764e5f85abf00c7cee4c4e19">set_thread_info_in_msg_metadata</a> (<a class="el" href="structflow_1_1log_1_1Msg__metadata.html">Msg_metadata</a> *msg_metadata)</td></tr>
<tr class="memdesc:a2d1a0283764e5f85abf00c7cee4c4e19 inherit pub_static_methods_classflow_1_1log_1_1Logger"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loads <code>msg_metadata-&gt;m_call_thread_nickname</code> (if set) or else <code>msg_metadata-&gt;m_call_thread_id</code>, based on whether/how <a class="el" href="classflow_1_1log_1_1Logger.html#a5600c71ccaa294650c7d34b596d90bf5" title="Sets or unsets the current thread&#39;s logging-worthy string name; optionally sets the OS thread name (s...">this_thread_set_logged_nickname()</a> was last called in the current thread.  <a href="classflow_1_1log_1_1Logger.html#a2d1a0283764e5f85abf00c7cee4c4e19">More...</a><br /></td></tr>
<tr class="separator:a2d1a0283764e5f85abf00c7cee4c4e19 inherit pub_static_methods_classflow_1_1log_1_1Logger"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ea9da10a13d3b422ba7162a13d7eeb1 inherit pub_static_methods_classflow_1_1log_1_1Logger"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Logger.html#a1ea9da10a13d3b422ba7162a13d7eeb1">set_thread_info</a> (std::string *call_thread_nickname, <a class="el" href="namespaceflow_1_1util.html#a0a4e7b2d3107bd630e0dc0c0b8f2e4de">flow::util::Thread_id</a> *call_thread_id)</td></tr>
<tr class="memdesc:a1ea9da10a13d3b422ba7162a13d7eeb1 inherit pub_static_methods_classflow_1_1log_1_1Logger"><td class="mdescLeft">&#160;</td><td class="mdescRight">Same as <a class="el" href="classflow_1_1log_1_1Logger.html#a2d1a0283764e5f85abf00c7cee4c4e19" title="Loads msg_metadata-&gt;m_call_thread_nickname (if set) or else msg_metadata-&gt;m_call_thread_id,...">set_thread_info_in_msg_metadata()</a> but targets the given two variables as opposed to a <a class="el" href="structflow_1_1log_1_1Msg__metadata.html" title="Simple data store containing all of the information generated at every logging call site by flow::log...">Msg_metadata</a>.  <a href="classflow_1_1log_1_1Logger.html#a1ea9da10a13d3b422ba7162a13d7eeb1">More...</a><br /></td></tr>
<tr class="separator:a1ea9da10a13d3b422ba7162a13d7eeb1 inherit pub_static_methods_classflow_1_1log_1_1Logger"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_static_methods_classflow_1_1util_1_1Unique__id__holder"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classflow_1_1util_1_1Unique__id__holder')"><img src="closed.png" alt="-"/>&#160;Static Public Member Functions inherited from <a class="el" href="classflow_1_1util_1_1Unique__id__holder.html">flow::util::Unique_id_holder</a></td></tr>
<tr class="memitem:a50489177a7731618ca130468c3872748 inherit pub_static_methods_classflow_1_1util_1_1Unique__id__holder"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classflow_1_1util_1_1Unique__id__holder.html#af9cbe2432658aac398498e0a7e96405f">id_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1util_1_1Unique__id__holder.html#a50489177a7731618ca130468c3872748">create_unique_id</a> ()</td></tr>
<tr class="memdesc:a50489177a7731618ca130468c3872748 inherit pub_static_methods_classflow_1_1util_1_1Unique__id__holder"><td class="mdescLeft">&#160;</td><td class="mdescRight">Short-hand for <code><a class="el" href="classflow_1_1util_1_1Unique__id__holder.html#a90705293787069f52372638d5450ef52" title="Thread-safely construct an ID whose value is different from any other object of this class,...">Unique_id_holder()</a>.<a class="el" href="classflow_1_1util_1_1Unique__id__holder.html#a24742b697933e623df30056aebbebfae" title="Raw unique ID identifying this object as well as any object of a derived type.">unique_id()</a></code>; useful when all you want is the unique integer itself.  <a href="classflow_1_1util_1_1Unique__id__holder.html#a50489177a7731618ca130468c3872748">More...</a><br /></td></tr>
<tr class="separator:a50489177a7731618ca130468c3872748 inherit pub_static_methods_classflow_1_1util_1_1Unique__id__holder"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >An implementation of <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> that logs messages to the given <code>ostream</code>s (e.g., <code>cout</code> or an <code>ofstream</code> for a file). </p>
<p >Protects against garbling due to simultaneous logging from multiple threads.</p>
<p >Vaguely speaking, this <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> is suitable for console (<code>cout</code>, <code>cerr</code>) output; and, in a pinch outside of a heavy-duty production/server environment, for file (<code>ofstream</code>) output. For heavy-duty file logging one should use <a class="el" href="classflow_1_1log_1_1Async__file__logger.html" title="An implementation of Logger that logs messages to a given file-system path but never blocks any loggi...">Async_file_logger</a>. The primary reason is performance; this is discussed in the <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> class doc header. A secondary reason is additional file-logging-specific utilities &ndash; such as rotation &ndash; are now or in the future going to be in <a class="el" href="classflow_1_1log_1_1Async__file__logger.html" title="An implementation of Logger that logs messages to a given file-system path but never blocks any loggi...">Async_file_logger</a>, as its purpose is heavy-duty file logging specifically.</p>
<h3>Thread safety</h3>
<p >As noted above, simultaneous logging from multiple threads is safe from output corruption, in that simultaneous <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a44192b92a16bc07f8d99beb6ad25c826" title="Implements interface method by synchronously logging the message and some subset of the metadata in a...">do_log()</a> calls for the same <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> targeting the same stream will log serially to each other.</p>
<p >Additionally, changes to the <a class="el" href="classflow_1_1log_1_1Config.html" title="Class used to configure the filtering and logging behavior of Loggers; its use in your custom Loggers...">Config</a> (which controls <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#aaf1987dc4e163db1c13e6f4407135fa9" title="Implements interface method by returning true if the severity and component (which is allowed to be n...">should_log()</a> behavior among other things), pointer to which is passed to constructor, are thread-safe against <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#aaf1987dc4e163db1c13e6f4407135fa9" title="Implements interface method by returning true if the severity and component (which is allowed to be n...">should_log()</a> and <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a44192b92a16bc07f8d99beb6ad25c826" title="Implements interface method by synchronously logging the message and some subset of the metadata in a...">do_log()</a> if and only if class <a class="el" href="classflow_1_1log_1_1Config.html" title="Class used to configure the filtering and logging behavior of Loggers; its use in your custom Loggers...">Config</a> doc header describes them as such. Short version: You can't modify the <a class="el" href="classflow_1_1log_1_1Config.html" title="Class used to configure the filtering and logging behavior of Loggers; its use in your custom Loggers...">Config</a> anymore (while <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#aaf1987dc4e163db1c13e6f4407135fa9" title="Implements interface method by returning true if the severity and component (which is allowed to be n...">should_log()</a> and <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a44192b92a16bc07f8d99beb6ad25c826" title="Implements interface method by synchronously logging the message and some subset of the metadata in a...">do_log()</a>) except you can dynamically modify verbosity via <a class="el" href="classflow_1_1log_1_1Config.html#ac562cc0132f6cfa81b42c332400033ae" title="Sets the default verbosity to the given value, to be used by subsequent output_whether_should_log() c...">Config::configure_default_verbosity()</a> and <a class="el" href="classflow_1_1log_1_1Config.html#adfde40890c0dc1fa8956451f44251dc8" title="Sets the per-component verbosity for the given component to the given value, to be used by subsequent...">Config::configure_component_verbosity()</a> or <a class="el" href="classflow_1_1log_1_1Config.html#a2f266ee7e22d1090ab4de76e532cab89" title="Like configure_component_verbosity(), but the component is to be specified by its registered string n...">Config::configure_component_verbosity_by_name()</a>.</p>
<p >There are no other mutable data (state), so that's that.</p>
<h3>Thread safety: Corner case: Don't cross the <code>ostream</code>s!</h3>
<p >There is another, arguably subtle, thread safety issue. Bottom line/summary: If you pass <code>ostream</code> S (including <code>cout</code> and <code>cerr</code>) into object <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html" title="An implementation of Logger that logs messages to the given ostreams (e.g., cout or an ofstream for a...">Simple_ostream_logger</a> S1 constructor, then don't access S from any other code, including outside code printing to S, AND including indirect access via any other <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html" title="An implementation of Logger that logs messages to the given ostreams (e.g., cout or an ofstream for a...">Simple_ostream_logger</a> S2 that isn't S1 &ndash; at least not when S1 might be logging.</p>
<p >Now in more detail: Suppose S is an underlying <code>ostream</code>; for example S could be <code>cerr</code>. Suppose <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html" title="An implementation of Logger that logs messages to the given ostreams (e.g., cout or an ofstream for a...">Simple_ostream_logger</a> S1 is constructed with S, meaning it will always print to <code>cerr</code>. Finally, suppose some other unrelated code <em>also</em> accesses the stream S <em>while</em> a log statement is printing to S through S1; for example that code might be writing some raw printouts to standard error by means of <code>cerr &lt;&lt;</code>. Hence, S is being write-accessed from 2 threads. At best, this can cause garbled output. (This is unavoidable but could be seen as acceptable functionally.) However the danger doesn't end there; internally S1 code will use stateful formatters to affect the output. Write ops via <code>ostream</code> formatters are <em>not</em> thread-safe against use of formatters on the same <code>ostream</code> from another thread. This can cause very-hard-to-identify crashes, such as double-frees reported from deep inside <code>ostream</code>-related library code. Garbled output may be okay in a pinch, but crashes and other concurrency-corruption issues are never okay!</p>
<p >One's reaction to that might be "of course!" &ndash; it's simply messing with an <code>ostream</code> from 2+ different threads simultaneously: it should be expected to break. However, an essentially identical problem &ndash; which one might assume wouldn't exist (but one would be wrong) &ndash; is the following. Suppose everything is as described in the previous paragraph, except that the "outside code accessing stream from another thread simultaneously" isn't unrelated but rather simply <em>another</em> <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html" title="An implementation of Logger that logs messages to the given ostreams (e.g., cout or an ofstream for a...">Simple_ostream_logger</a> S2 that happened to be constructed against <code>ostream</code> S, same as S1 was. This, too, can break dangerously in the same ways and for the same reason. That is, <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html" title="An implementation of Logger that logs messages to the given ostreams (e.g., cout or an ofstream for a...">Simple_ostream_logger</a> takes no special measures to prevent this; all built-in thread-safety measures apply to multi-threaded uses of each given <code>*this</code> &ndash; not across different <code>*this</code>es. </p>

<p class="definition">Definition at line <a class="el" href="simple__ostream__logger_8hpp_source.html#l00083">83</a> of file <a class="el" href="simple__ostream__logger_8hpp_source.html">simple_ostream_logger.hpp</a>.</p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="aab34dd83954eeea35278207912589d0f" name="aab34dd83954eeea35278207912589d0f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aab34dd83954eeea35278207912589d0f">&#9670;&nbsp;</a></span>Ostream_log_msg_writer_ptr</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#aab34dd83954eeea35278207912589d0f">flow::log::Simple_ostream_logger::Ostream_log_msg_writer_ptr</a> =  boost::shared_ptr&lt;<a class="el" href="classflow_1_1log_1_1Ostream__log__msg__writer.html">Ostream_log_msg_writer</a>&gt;</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Short-hand for ref-counted pointer to a given <a class="el" href="classflow_1_1log_1_1Ostream__log__msg__writer.html" title="Utility class, each object of which wraps a given ostream and outputs discrete messages to it adorned...">Ostream_log_msg_writer</a>. See <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a1ef85d2192fb0cd3977944a20bfa61f9" title="Stream writers via which to log messages, each element corresponding to a certain set of possible sev...">m_os_writers</a> for ref-count rationale. </p>

<p class="definition">Definition at line <a class="el" href="simple__ostream__logger_8hpp_source.html#l00161">161</a> of file <a class="el" href="simple__ostream__logger_8hpp_source.html">simple_ostream_logger.hpp</a>.</p>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a5ee701f0f163047f9620ab91d653da18" name="a5ee701f0f163047f9620ab91d653da18"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5ee701f0f163047f9620ab91d653da18">&#9670;&nbsp;</a></span>Simple_ostream_logger()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">flow::log::Simple_ostream_logger::Simple_ostream_logger </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classflow_1_1log_1_1Config.html">Config</a> *&#160;</td>
          <td class="paramname"><em>config</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::ostream &amp;&#160;</td>
          <td class="paramname"><em>os</em> = <code>std::cout</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::ostream &amp;&#160;</td>
          <td class="paramname"><em>os_for_err</em> = <code>std::cerr</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs logger to subsequently log to the given standard <code>ostream</code> (or 2 thereof). </p>
<dl class="section warning"><dt>Warning</dt><dd>It is strongly recommended that numeric format state (for integers) in <code>os</code> and <code>os_for_err</code> be at default values (e.g, no <code>std::hex</code> or non-default fill character) at entry to this constructor. Otherwise the contents of prefixes within log output will be formatted in some undefined way.</dd></dl>
<p>Note that usually one SHOULD avoid writing anything to <code>os</code> or <code>os_for_err</code> once they've been passed to <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html" title="An implementation of Logger that logs messages to the given ostreams (e.g., cout or an ofstream for a...">Simple_ostream_logger</a>. Logs should not (usually) be mixed with other output, as (1) it would look odd; and (2) interleaving may occur, since there is no mutex making logging mutually exclusive against other output to the same stream(s). Update: It might be worse that that; see thread safety notes in <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html" title="An implementation of Logger that logs messages to the given ostreams (e.g., cout or an ofstream for a...">Simple_ostream_logger</a> doc header. Reiterating: Really one and only one <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html" title="An implementation of Logger that logs messages to the given ostreams (e.g., cout or an ofstream for a...">Simple_ostream_logger</a> should access a given <code>ostream</code>, and no other code should.</p>
<p >The case <code>&amp;os == &amp;os_for_err</code> (in other words they are the same stream) is not only allowed but likely common, so that post-factum redirect of <code>stderr</code> into <code>stdout</code> (often done via <code>2&gt;&amp;1</code> on command line) becomes unnecessary.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">config</td><td>Controls behavior of this <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a>. In particular, it affects <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#aaf1987dc4e163db1c13e6f4407135fa9" title="Implements interface method by returning true if the severity and component (which is allowed to be n...">should_log()</a> logic (verbosity default and per-component) and output format (such as time stamp format). See thread safety notes in class doc header. This is saved in <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a57abde2223144cdec0f1f4edc35fdc88" title="Reference to the config object passed to constructor. Note that object is mutable; see notes on threa...">m_config</a>. </td></tr>
    <tr><td class="paramname">os</td><td><code>ostream</code> to which to log messages of severity strictly less severe than <a class="el" href="namespaceflow_1_1log.html#a5c602384e6fe9d7642740ac2fae4ad04a4aee6034ce9dbc2b5c36f27c80abe021" title="Message indicates a &quot;bad&quot; condition that is not frequent enough to be of severity Sev::S_TRACE.">Sev::S_WARNING</a>. </td></tr>
    <tr><td class="paramname">os_for_err</td><td><code>ostream</code> to which to log messages of severity <a class="el" href="namespaceflow_1_1log.html#a5c602384e6fe9d7642740ac2fae4ad04a4aee6034ce9dbc2b5c36f27c80abe021" title="Message indicates a &quot;bad&quot; condition that is not frequent enough to be of severity Sev::S_TRACE.">Sev::S_WARNING</a> or more severe. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="simple__ostream__logger_8cpp_source.html#l00027">27</a> of file <a class="el" href="simple__ostream__logger_8cpp_source.html">simple_ostream_logger.cpp</a>.</p>

<p class="reference">References <a class="el" href="simple__ostream__logger_8hpp_source.html#l00154">m_config</a>, and <a class="el" href="simple__ostream__logger_8hpp_source.html#l00172">m_os_writers</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a44192b92a16bc07f8d99beb6ad25c826" name="a44192b92a16bc07f8d99beb6ad25c826"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44192b92a16bc07f8d99beb6ad25c826">&#9670;&nbsp;</a></span>do_log()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void flow::log::Simple_ostream_logger::do_log </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structflow_1_1log_1_1Msg__metadata.html">Msg_metadata</a> *&#160;</td>
          <td class="paramname"><em>metadata</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceflow_1_1util.html#ae4dc52186797094b3040379ff19124c9">util::String_view</a>&#160;</td>
          <td class="paramname"><em>msg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Implements interface method by synchronously logging the message and some subset of the metadata in a fashion controlled by <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a57abde2223144cdec0f1f4edc35fdc88" title="Reference to the config object passed to constructor. Note that object is mutable; see notes on threa...">m_config</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">metadata</td><td>All information to potentially log in addition to <code>msg</code>. </td></tr>
    <tr><td class="paramname">msg</td><td>The message. </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="classflow_1_1log_1_1Logger.html#a934667f16dd6ca0841e521296ab3a6e2">flow::log::Logger</a>.</p>

<p class="definition">Definition at line <a class="el" href="simple__ostream__logger_8cpp_source.html#l00053">53</a> of file <a class="el" href="simple__ostream__logger_8cpp_source.html">simple_ostream_logger.cpp</a>.</p>

<p class="reference">References <a class="el" href="simple__ostream__logger_8hpp_source.html#l00175">m_log_mutex</a>, <a class="el" href="log_8hpp_source.html#l01051">flow::log::Msg_metadata::m_msg_sev</a>, <a class="el" href="simple__ostream__logger_8hpp_source.html#l00172">m_os_writers</a>, and <a class="el" href="namespaceflow_1_1log.html#a5c602384e6fe9d7642740ac2fae4ad04a4aee6034ce9dbc2b5c36f27c80abe021">flow::log::S_WARNING</a>.</p>

</div>
</div>
<a id="a1548d51e8314a9cff0669f20cae9ae76" name="a1548d51e8314a9cff0669f20cae9ae76"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1548d51e8314a9cff0669f20cae9ae76">&#9670;&nbsp;</a></span>logs_asynchronously()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classbool.html">bool</a> flow::log::Simple_ostream_logger::logs_asynchronously </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Implements interface method by returning <code>false</code>, indicating that this <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> will not need the contents of <code>*metadata</code> and <code>msg</code> passed to <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a44192b92a16bc07f8d99beb6ad25c826" title="Implements interface method by synchronously logging the message and some subset of the metadata in a...">do_log()</a>, as the latter will output them synchronously. </p>
<dl class="section return"><dt>Returns</dt><dd>See above. </dd></dl>

<p>Implements <a class="el" href="classflow_1_1log_1_1Logger.html#ae04868e2a384e60a349ecba8340cd731">flow::log::Logger</a>.</p>

<p class="definition">Definition at line <a class="el" href="simple__ostream__logger_8cpp_source.html#l00048">48</a> of file <a class="el" href="simple__ostream__logger_8cpp_source.html">simple_ostream_logger.cpp</a>.</p>

</div>
</div>
<a id="aaf1987dc4e163db1c13e6f4407135fa9" name="aaf1987dc4e163db1c13e6f4407135fa9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf1987dc4e163db1c13e6f4407135fa9">&#9670;&nbsp;</a></span>should_log()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classbool.html">bool</a> flow::log::Simple_ostream_logger::should_log </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceflow_1_1log.html#a5c602384e6fe9d7642740ac2fae4ad04">Sev</a>&#160;</td>
          <td class="paramname"><em>sev</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;&#160;</td>
          <td class="paramname"><em>component</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Implements interface method by returning <code>true</code> if the severity and component (which is allowed to be null) indicate it should. </p>
<p >As of this writing not thread-safe against changes to <code>*m_config</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sev</td><td>Severity of the message. </td></tr>
    <tr><td class="paramname">component</td><td><a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> of the message. Reminder: <code>component.empty() == true</code> is allowed. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>See above. </dd></dl>

<p>Implements <a class="el" href="classflow_1_1log_1_1Logger.html#ac8a2e7a33fe3fbc0c29ead62ed98c022">flow::log::Logger</a>.</p>

<p class="definition">Definition at line <a class="el" href="simple__ostream__logger_8cpp_source.html#l00043">43</a> of file <a class="el" href="simple__ostream__logger_8cpp_source.html">simple_ostream_logger.cpp</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a57abde2223144cdec0f1f4edc35fdc88" name="a57abde2223144cdec0f1f4edc35fdc88"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a57abde2223144cdec0f1f4edc35fdc88">&#9670;&nbsp;</a></span>m_config</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classflow_1_1log_1_1Config.html">Config</a>* const flow::log::Simple_ostream_logger::m_config</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reference to the config object passed to constructor. Note that object is mutable; see notes on thread safety. </p>

<p class="definition">Definition at line <a class="el" href="simple__ostream__logger_8hpp_source.html#l00154">154</a> of file <a class="el" href="simple__ostream__logger_8hpp_source.html">simple_ostream_logger.hpp</a>.</p>

<p class="reference">Referenced by <a class="el" href="simple__ostream__logger_8cpp_source.html#l00027">Simple_ostream_logger()</a>.</p>

</div>
</div>
<a id="afb59fd5bf48efeb52d11af8a2d4d2379" name="afb59fd5bf48efeb52d11af8a2d4d2379"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afb59fd5bf48efeb52d11af8a2d4d2379">&#9670;&nbsp;</a></span>m_log_mutex</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceflow_1_1util.html#add6ade273326f27eaf9bfd170a909626">util::Mutex_non_recursive</a> flow::log::Simple_ostream_logger::m_log_mutex</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">mutable</span><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Mutex protecting against log messages being logged concurrently and thus being garbled. </p>

<p class="definition">Definition at line <a class="el" href="simple__ostream__logger_8hpp_source.html#l00175">175</a> of file <a class="el" href="simple__ostream__logger_8hpp_source.html">simple_ostream_logger.hpp</a>.</p>

<p class="reference">Referenced by <a class="el" href="simple__ostream__logger_8cpp_source.html#l00053">do_log()</a>.</p>

</div>
</div>
<a id="a1ef85d2192fb0cd3977944a20bfa61f9" name="a1ef85d2192fb0cd3977944a20bfa61f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ef85d2192fb0cd3977944a20bfa61f9">&#9670;&nbsp;</a></span>m_os_writers</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">boost::array&lt;<a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#aab34dd83954eeea35278207912589d0f">Ostream_log_msg_writer_ptr</a>, 2&gt; flow::log::Simple_ostream_logger::m_os_writers</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Stream writers via which to log messages, each element corresponding to a certain set of possible severities (as of this writing, warnings or worse versus all others). </p>
<p >2+ pointers stored may point to the same object (see constructor body), if they share the same <code>ostream</code>. In that case, ref-counted pointer mechanics will ensure the shared <a class="el" href="classflow_1_1log_1_1Ostream__log__msg__writer.html" title="Utility class, each object of which wraps a given ostream and outputs discrete messages to it adorned...">Ostream_log_msg_writer</a> is freed when <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html#a1ef85d2192fb0cd3977944a20bfa61f9" title="Stream writers via which to log messages, each element corresponding to a certain set of possible sev...">m_os_writers</a> <code>array</code> is freed, when <code>*this</code> is destroyed. </p>

<p class="definition">Definition at line <a class="el" href="simple__ostream__logger_8hpp_source.html#l00172">172</a> of file <a class="el" href="simple__ostream__logger_8hpp_source.html">simple_ostream_logger.hpp</a>.</p>

<p class="reference">Referenced by <a class="el" href="simple__ostream__logger_8cpp_source.html#l00053">do_log()</a>, and <a class="el" href="simple__ostream__logger_8cpp_source.html#l00027">Simple_ostream_logger()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>log/<a class="el" href="simple__ostream__logger_8hpp_source.html">simple_ostream_logger.hpp</a></li>
<li>log/<a class="el" href="simple__ostream__logger_8cpp_source.html">simple_ostream_logger.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Mar 28 2025 22:55:35 for Flow by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
